<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * @category    design
 * @package     default_default
 * @copyright   Copyright (c) 2011 Mageex
 */
?>
<link href="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS) . 'prototype/windows/themes/default.css'; ?>" rel="stylesheet"/>
<link href="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS) . 'prototype/windows/themes/magento.css'; ?>" rel="stylesheet"/>
<style type="text/css">
.dialog{
	display: block;
    position: absolute;
	border: 1px solid #555555;
}
</style>
<script type="text/javascript">

    function initAdvanceSeo() {
        var textareaId = 'mageex_advanceseo_metatag_metatitle';
    	var url = '<?php echo Mage::helper("adminhtml")->getUrl("advanceseo/advanceseo/gettemplate/") ?>';
		advanceseos = new AdvanceSeos(url,textareaId,'advanceseos');
		var textareaIdd = 'mageex_advanceseo_metatag_metades';
    	var urld = '<?php echo Mage::helper("adminhtml")->getUrl("advanceseo/advanceseo/gettemplate/type/des") ?>';
        advanceseosd = new AdvanceSeos(urld,textareaIdd,'advanceseosd');
		document.getElementById("mageex_advanceseo_metatag_active").style.display = "none";
		$('mageex_advanceseo_metatag_active').up().insert('<button type="button" id="metades_multifuncbutton" onclick="advanceseosd.button()"><span id="advanceseo_multifuncbutton_label">{Insert Variables}</span></button>');
		document.getElementById("row_mageex_advanceseo_rewritedata_date_start").style.display = "none";
		document.getElementById("row_mageex_advanceseo_rewritedata_processdatefrom").style.display = "none";
		
		obj = document.getElementById("mageex_advanceseo_rewritedata_selectdatefrom");
		if(obj.value == 'C'){
				document.getElementById("row_mageex_advanceseo_rewritedata_processdatefrom").style.display = "";
		}
		Event.observe(obj,'change',function(){
			if(obj.value == 'C'){
				document.getElementById("row_mageex_advanceseo_rewritedata_processdatefrom").style.display = "";
			}else{
				document.getElementById("row_mageex_advanceseo_rewritedata_processdatefrom").style.display = "none";
			}
		});
		//objp.onchange();
		objp = document.getElementById("mageex_advanceseo_rewritedata_frequency");
		if(objp.value == 'C'){
				document.getElementById("row_mageex_advanceseo_rewritedata_date_start").style.display = "";
		}
		Event.observe(objp,'change',function(){
			if(objp.value == 'C'){
				document.getElementById("row_mageex_advanceseo_rewritedata_date_start").style.display = "";
			}else{
				document.getElementById("row_mageex_advanceseo_rewritedata_date_start").style.display = "none";
			}
		});
		//objp.onchange();
    }
	function initProcessSelect(){
		
		objp = document.getElementById("mageex_advanceseo_rewritedata_frequency");
		Event.observe(obj,'change',function(){
			if(objp.value == 'C'){
				document.getElementById("row_mageex_advanceseo_rewritedata_date_start").style.display = "";
			}else{
				document.getElementById("row_mageex_advanceseo_rewritedata_date_start").style.display = "none";
			}
		});
		objp.onchange();
	}

</script>

